//
//  XHRNavigationController.m
//  快医
//
//  Created by 胥鸿儒 on 16/7/4.
//  Copyright © 2016年 xuhongru. All rights reserved.
//

#import "XHRNavigationController.h"
#import "XHRHomeViewController.h"
@interface XHRNavigationController ()

@end

@implementation XHRNavigationController

+ (void)initialize
{
    UINavigationBar *navigationBar = [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[self]];
    
    [navigationBar setBackgroundImage:[UIImage imageNamed:@"nav"] forBarMetrics:UIBarMetricsDefault];
    
    NSMutableDictionary *propertyDictionary = [NSMutableDictionary dictionary];
    propertyDictionary[NSFontAttributeName] = [UIFont systemFontOfSize:17];
    propertyDictionary[NSForegroundColorAttributeName] = [UIColor blackColor];
    [navigationBar setTitleTextAttributes:propertyDictionary.copy];
    
    UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[self]];
    propertyDictionary[NSFontAttributeName] = [UIFont systemFontOfSize:15];
    [barButtonItem setTitleTextAttributes:propertyDictionary.copy forState:UIControlStateNormal];
    
    [barButtonItem setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -200) forBarMetrics:UIBarMetricsDefault];
    
    //两个属性必须同时设置才有效
    navigationBar.backIndicatorTransitionMaskImage = [UIImage originalImageNamed:@"product_button_back_nor.png"];
    navigationBar.backIndicatorImage = [UIImage originalImageNamed:@"product_button_back_nor.png"];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self pushViewController:[[XHRHomeViewController alloc]init] animated:YES];
    
}
@end
